
#ifndef BBCORE_D330172E_7597_43E4_966F_2A3B86DB560F
#define BBCORE_D330172E_7597_43E4_966F_2A3B86DB560F

#include "bbCFG.h"
#include "bbDx9.h"
#include "bbInput.h"

LRESULT CALLBACK WndProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam);

class bbCore
{
private:
	/*-------------------------------*/
	/*			Statistics			 */
	/*-------------------------------*/
	int m_fps, m_count;
	unsigned long m_startTime;
	/*-------------------------------*/
	HWND bbMainWindow;
	int bbWidth, bbHeight;
	/* classes */
	bbDx9  *bbRender;
	bbInpt *bbInput;
	/* data */
	const char *data_dir;
	bool bb_CreateWindowC(const char *title = DEFAULT_TITLE, int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT);
	bool bb_Frame();
public:
	bbCore(const char *title = DEFAULT_TITLE, int width = DEFAULT_WIDTH, int height = DEFAULT_HEIGHT, bool allow_resize = false);
	~bbCore();

	bool bb_InitDirect(bool fullscreen = false, bool vsync = false);
	bool bb_InitFileSystem(const char *zip_src = NULL);
	void bb_RunCore(bool(*bbRenderFunction)() = NULL, bool(*bbFrameFunction)() = NULL, void(*bbContentLoadFunction)() = NULL, void(*bbUnloadFunction)() = NULL);

	bool bb_IsEngineInited;
	int bb_ExitCode;
	int bb_GetFPS();

	bbDx9  *bb_GetRender();
	bbInpt *bb_GetInput();
/*
// 	
// 	;
// 	void bb_GetResource();
// 	void bb_GetSound();
*/
};

#endif // BBCORE_D330172E_7597_43E4_966F_2A3B86DB560F
